package com.people.whx.demo.rocketmq;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@RocketMQMessageListener(topic = "test-topic",consumerGroup = "rocketmq-group")
@Component
@Slf4j
public class Consumer implements RocketMQListener<Message> {

    public void onMessage(Message message){
        log.info("the info from producer: "+message.getUsername()+" is:"+message.getMessage());
    }
}
